﻿
using CSharpLibs.Annotations;

#pragma warning disable 0169

namespace System
{
	[Builtin]
	public struct Int32 : ISignIntegralValue, IComparable, IComparable<Int32>, IEquatable<Int32>
	{
		public const int MaxValue = 2147483647;
		public const int MinValue = -2147483648;

		[DummyPrimitiveField]
		private int ff;

		public int CompareTo(object o)
		{
			if(!(o is Int32))
				Environment.Exit(1);

			return PrimitiveHelper.DoCompareOpIntegral(this, (Int32)o);
		}

		public int CompareTo(Int32 i)
		{ return PrimitiveHelper.DoCompareOpIntegral(this, i); }

		public override bool Equals(object o)
		{ return (o is Int32) && (this == ((Int32)o)); }

		public bool Equals(Int32 i)
		{ return this == i; }

		public override int GetHashCode()
		{ return ((int)(this >> 2)); }

		public static int Parse(String sv)
		{ return (int)PrimitiveHelper.ParseIntegral(sv); }

		public override string ToString()
		{ return PrimitiveHelper.IntegralToString(this); }
	}
}

#pragma warning restore 0169
